Find the build directory matching the current interpreter
authorDmitry Shachnev <mitya57@debian.org>
Sun, 14 Nov 2021 18:08:50 +0000 (21:08 +0300)
committerStuart Prescott <stuart@debian.org>
Tue, 23 Sep 2025 00:19:51 +0000 (10:19 +1000)
This is needed to allow us to run tests with all supported Python versions.
Without this patch, the latest build directory will be always picked, no
matter what the current interpreter is.

Gbp-Pq: Name 0001-test-with-current-interpreter.patch

testing/buildlog.py

index 90ff436d8e4b7e2027a212c447c212fe3e90a553..034f10398470971052fb67db5fab9ba2e1a5e938 100644 (file)
@@ -63,6 +63,11 @@ class BuildLog:
                     )
                     sys.exit(1)
 
+                # We need to find the build directory for the current interpreter
+                py_version = "{}.{}".format(sys.version_info[0], sys.version_info[1])
+                if py_version not in build_classifiers:
+                    continue
+
                 if not os.path.exists(build_dir):
                     rel_dir, low_part = os.path.split(build_dir)
                     rel_dir, two_part = os.path.split(rel_dir)